﻿Imports DevExpress.XtraSplashScreen
Imports DevExpress.XtraEditors

Public Class DMNghiepVu
    Public Overrides Sub setSubSau_TaoMoi()
        Me.TinhtrangISearchLookupEdit.EditValue = "1"
    End Sub
    Private Sub LoadDuLieu()
        SplashScreenManager.ShowForm(GetType(WaitForm1))
        Me.DoiTuongCongNoTableAdapter.Fill(Me.PCV_CLINICDataSet_Don.DoiTuongCongNo)
        Me.DMNghiepVuTableAdapter.Fill(Me.PCV_CLINICDataSet_Don.DMNghiepVu)
        Me.DMTaiKhoanKeToanCap2TableAdapter.Fill(Me.PCV_CLINICDataSet_Don.DMTaiKhoanKeToanCap2)
        Me.DMKhoTableAdapter.Fill(Me.PCV_CLINICDataSet_Don.DMKho)
        Me.DMSoChungTuTableAdapter.Fill(Me.PCV_CLINICDataSet_Don.DMSoChungTu)
        Me.TinhTrangTableAdapter.Fill(Me.PCV_CLINICDataSet_Don.TinhTrang)
        SplashScreenManager.CloseForm()
    End Sub
    Private Sub DMNghiepVu_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        LoadDuLieu()
    End Sub
    Public Sub New()
        InitializeComponent()
        Me.setObj(Me.PCV_CLINICDataSet_Don, Me.PCV_CLINICDataSet_Don.DMNghiepVu, Me.DMNghiepVuBindingSource, Me.TableAdapterManager, Me.DMNghiepVuTableAdapter, Me.MaITextEdit)
    End Sub
    Private Sub IGridView1_InitNewRow(sender As Object, e As DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs) Handles IGridView1.InitNewRow
        Me.IGridView1.SetFocusedRowCellValue("tinhtrang", "1")
    End Sub
    Private Sub RepositoryItemISearchLookUpEdit_DMTaiKhoanKeToanCap2_EditValueChanging(sender As Object, e As DevExpress.XtraEditors.Controls.ChangingEventArgs) Handles RepositoryItemISearchLookUpEdit_DMTaiKhoanKeToanCap2.EditValueChanging
        Dim editor As SearchLookUpEdit = CType(sender, SearchLookUpEdit)
        Dim rowHandle As Integer = editor.Properties.GetIndexByKeyValue(e.NewValue)
        If Me.IGridView1.FocusedColumn.FieldName = "taikhoanno" Then
            Me.IGridView1.SetFocusedRowCellValue("taikhoanno", editor.Properties.View.GetRowCellValue(rowHandle, "ma"))
        End If
        If Me.IGridView1.FocusedColumn.FieldName = "taikhoanco" Then
            Me.IGridView1.SetFocusedRowCellValue("taikhoanco", editor.Properties.View.GetRowCellValue(rowHandle, "ma"))
        End If
        If Me.IGridView1.FocusedColumn.FieldName = "taikhoanvat" Then
            Me.IGridView1.SetFocusedRowCellValue("taikhoanvat", editor.Properties.View.GetRowCellValue(rowHandle, "ma"))
        End If
    End Sub
End Class
